import time

from EChatIMSDKBridge import echatimSdk

# echatimsdk dll 路径
# TEST_DLL_PATH = "C:\\Users\\Administrator\\CLionProjects\\echatim-client-cpp-core\\cmake-build-debug\\libs\\echatimsdk.dll"
TEST_DLL_PATH = "/Users/zhiqiangdai/cmake-projects/echatim-client-cpp-core/cmake-build-debug/libs/libechatimsdk.dylib"

if __name__ == "__main__":
    # FIXME:出现异常 configJson = "{}"
    configJson = "{\"host\":\"api.echatim.cn\",\"httpPort\":58082,\"socketPort\":59092,\"key\":\"TSDKTEST00001\",\"secret\":\"\",\"apiTransport\":\"HTTP\",\"loginAuid\":\"admin\",\"loginToken\":\"admin\"}"
    # 初始化SDK
    echatimSdk.sdkInit(TEST_DLL_PATH, configJson)

    cb = lambda response: print("=== sdk api return:{} ".format(response))
    # 测试API
    echatimSdk.apiCall("userGet", "{\"auid\":\"admin\"}", cb)
    while True:

        time.sleep(1)

    pass
